package com.wyy.designpatterns.singleton;

public class SingletonTest {
	/**
	 * 代码网址链接：
	 * http://blog.csdn.net/zhangerqing/article/details/8194653
	 */
    private static SingletonTest instance = null;  
    
    private SingletonTest() {  
    }
  
    private static synchronized void syncInit() {
        if (instance == null) {
            instance = new SingletonTest();
        }  
    }  
  
    public static SingletonTest getInstance() {
        if (instance == null) {
            syncInit();
        }
        return instance;
    }
}
